package uploader

import (
	"crypto/rand"
	"fmt"
	"time"
)

func GenerateObjectName() string {
	const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	bytes := make([]byte, 32)
	rand.Read(bytes)
	for i, b := range bytes {
		bytes[i] = letters[int(b)%len(letters)]
	}
	dateStr := time.Now().Format("20060102")
	return fmt.Sprintf("material_video/%s/%s", dateStr, string(bytes))
}
